﻿using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Avalon.Core.Providers
{
    public class LibraryProvider
    {
        public IEnumerable<Assembly> GetDataModelAssemblies()
        {
            Configuration.Configuration config = Avalon.Core.Configuration.Configuration.CreateConfiguration("~/Configuration/AssemblyConfiguration.xml");
            return config.DataModelAssemblies.Select(aInfo => Assembly.Load(aInfo.Type));
        }

        public IEnumerable<Assembly> GetViewModelAssemblies()
        {
            Configuration.Configuration config = Avalon.Core.Configuration.Configuration.CreateConfiguration("~/Configuration/AssemblyConfiguration.xml");
            return config.ViewModelAssemblies.Select(aInfo => Assembly.Load(aInfo.Type));
        }

        public IEnumerable<Assembly> GetPipelineAssemblies()
        {
            Configuration.Configuration config = Avalon.Core.Configuration.Configuration.CreateConfiguration("~/Configuration/AssemblyConfiguration.xml");
            return config.PipelineAssemblies.Select(aInfo => Assembly.Load(aInfo.Type));
        }

    }

}
